# coding:utf-8
import sys

from PySide6.QtWidgets import QApplication, QMainWindow

from QtFFMediaPlayer import VideoPlayerWidget


class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('Video Player')
        self.setMinimumSize(1000, 600)
        self.videoPlayerWidget = VideoPlayerWidget(self)
        # source = 'https://v16m-default.akamaized.net/bb587e20d58cb76126e137f67e9ab708/67ee8913/video/tos/alisg/tos-alisg-ve-0051c001-sg/oInB4uDqFnXY7bt5ANYeABHDEn4IEQRfgnW8BE/?a=2011&bti=MzhALjBg&ch=0&cr=0&dr=0&net=5&cd=0%7C0%7C0%7C0&br=1230&bt=615&cs=0&ds=3&ft=EeF4ntZZI0rd12NvIZdFeIxRNj0fCF_45SY&mime_type=video_mp4&qs=0&rc=ODM4aDtpZTNlPDc0aTVnaUBpM2VqOm05cjlweTMzODYzNEAyYTEtMGMwNWMxNTZfMzUzYSNzNGdlMmQ0cGpgLS1kMC1zcw%3D%3D&vvpl=1&l=202504030648568438A79DB6ABC1734B1C&btag=e000a8000'
        # source = r"C:\Users\26406\Downloads\画江湖之天罡.mp4"
        source = 'https://svipsvip.ffzy-online5.com/20250403/39833_00275937/index.m3u8'
        self.videoPlayerWidget.setSource(source)
        # self.videoPlayerWidget.play()


        self.setCentralWidget(self.videoPlayerWidget)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = MainWindow()
    w.show()
    sys.exit(app.exec())
